<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
</head>
<body>
<form>
    学号：<label id="id"><input type="text"></label><br>
    姓名：<label id="name"><input type="text"></label><br>
    电话：<label id="tel"><input type="text"></label><br>
    密码：<label><input id="password" type="text"></label><br>
    <input id="btn" type="button" value="登录">
</form>
<script type="text/javascript">
    //密码正则
    const passwordRegex = /^(?=.*[a-z])[a-zA-Z0-9!@#$%^&*()_+{}|:;<>,.?~]{10,16}$/;
    document.getElementById("btn").onclick = function () {
        //获取密码
        var pwd = document.getElementById("password").value;
        console.log(pwd);
        if (!passwordRegex.test(pwd)) {
            alert("密码格式不对");
            return
        }
        window.location.href = "/home4/home_town.html";
    }
</script>
</body>
</html>